﻿<ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:Controls="clr-namespace:MyToolkit.Controls"
					xmlns:Media="clr-namespace:MyToolkit.Media">

	<Style TargetType="Controls:WatermarkedTextBox">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Controls:WatermarkedTextBox">
					<TextBox x:Name="textBox" />
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<Style TargetType="Controls:ImageButton">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Controls:ImageButton">
					<Grid>
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal"/>
								<VisualState x:Name="MouseOver"/>
								<VisualState x:Name="Pressed">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="PressedImage">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="NormalImage">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Collapsed</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Disabled"/>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Image x:Name="NormalImage" Source="{TemplateBinding Image}"/>
						<Image x:Name="PressedImage" Source="{TemplateBinding PressedImage}" Visibility="Collapsed"/>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style TargetType="Controls:UnstyledButton">
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="BorderBrush" Value="{x:Null}" />
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Padding" Value="0,0,0,0"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    </Style>

	<Style TargetType="Controls:PanAndZoomViewer">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Controls:PanAndZoomViewer">
					<ContentPresenter x:Name="content">
						<ContentPresenter.RenderTransform>
							<CompositeTransform ScaleX="1" ScaleY="1" TranslateX="0" TranslateY="0"/>
						</ContentPresenter.RenderTransform>
					</ContentPresenter>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style TargetType="Controls:PanAndZoomImage">
		<Setter Property="Stretch" Value="UniformToFill"/>
		<Setter Property="Background" Value="{StaticResource PhoneDisabledBrush}" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Controls:PanAndZoomImage">
					<ContentPresenter x:Name="content">
						<ContentPresenter.RenderTransform>
							<CompositeTransform ScaleX="1" ScaleY="1" TranslateX="0" TranslateY="0"/>
						</ContentPresenter.RenderTransform>

						<Border Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Background}" 
								Margin="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=InnerMargin}">
							<Image Media:ImageHelper.Source="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Source}" 
								  Stretch="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Stretch}" 
								   x:Name="image">
							</Image>
						</Border>
					</ContentPresenter>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>
  